<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <title>查询用户</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css"
          integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
            integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
            integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js"
            integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI"
            crossorigin="anonymous"></script>
    <style>
        .mybtn a {
            color: #fff;
            font-weight: 500;
        }

        .mybtn a:hover {
            color: #fff;
        }

        a:hover {
            text-decoration: none;
        }
    </style>
</head>
<body>
<div>
    <div class="mybtn">
        <button type="button" class="btn btn-success"><a th:href="@{/index}">返回菜单</a></button>
        <button type="button" class="btn btn-danger"><a th:href="@{/logout}">注销</a></button>
        <button type="button" class="btn btn-primary" sec:authorize="hasAuthority('MYUSER_ADD')">
            <a th:href="@{/myuser/add}">添加用户</a>
        </button>
    </div>
    <table class="table table-striped" sec:authorize="hasAuthority('MYUSER_VIEW')">
        <thead>
        <tr>
            <th scope="col">用户名</th>
<!--            <th scope="col">角色编号</th>-->
<!--            <th scope="col">角色名称</th>-->
            <th scope="col">角色描述</th>
<!--            <th scope="col">权限编号</th>-->
<!--            <th scope="col">权限名称</th>-->
            <th scope="col">权限描述</th>
            <th scope="col">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="maps:${myUserMap}">
            <td th:text="${maps.value.getUsername()}"></td>
<!--            <td th:text="${maps.value.getRid()}"></td>-->
<!--            <td th:text="${maps.value.getRname()}"></td>-->
            <td th:text="${maps.value.getRdescription()}"></td>
<!--            <td th:text="${maps.value.getAid()}"></td>-->
<!--            <td th:text="${maps.value.getAname()}"></td>-->
            <td th:text="${maps.value.getAdescription()}"></td>
            <td>
                <a sec:authorize="hasAuthority('MYUSER_UPDATE')" th:href="@{'/myuser/update/'+${maps.key}+'/'+${maps.value.getUsername()}+'/'+${maps.value.getRid()}}">修改</a>
                <a sec:authorize="hasAuthority('MYUSER_DELETE')" th:href="@{'/myuser/delete/'+${maps.key}}">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>